<template>
  <!-- 侧边菜单 -->
  <div class="side">
    <div class="side-wrapper">
      <!-- 二级菜单 -->
      <div class="side-menu">
        <dl>
          <dt><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> {{ topMenu }}</dt>
          <dd v-for="(item, index) in sideMenus"><a href="javascript:;" @click="loadWorkPage(item.action, item.children, item.rightsName, $event)">{{ item.rightsName }}</a></dd>
        </dl>
      </div>
      <!-- 二级菜单 end -->
    </div>
  </div>
</template>

<script>
export default {
  name: 'vSideMenu',
  methods: {
    loadWorkPage: function (action, rights, menuName, event) {
      this.$emit('change-side-menu', menuName);
      // 权限保存处理 key: action, value: rights
      //jQuery(event.target).parent('dd').addClass('current').siblings().removeClass('current');
      this.$openTabPage( {path: action, title: menuName, opsRights: rights} );
    }
  },
  props: ['sideMenus', 'topMenu'],
  data () {
    return {
      msg: ''
    }
  }
}
</script>

